<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>学员上课登记</title>
<link rel="stylesheet" href="../../easyui/themes/default/easyui.css"
	type="text/css" media="screen" />
<link rel="stylesheet" href="../../easyui/themes/icon.css"
	type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/main.css" type="text/css"
	media="screen" />
<link rel="stylesheet" type="text/css" href="../../css/Tooltip.css" />
<script src="../../myjs/student/studentcheckin.js"></script>
<script src="../../easyui/jquery-1.4.4.min.js"></script>
<script src="../../easyui/jquery.easyui.min.js"></script>
<!-- mytab -->
<script src="../../myjs/myTab.js"></script>
<!-- sys -->
<script src="../../myjs/sys.js"></script>
<script src="../../myjs/DatePicker/WdatePicker.js"></script>
<script src="../../easyui/easyMask.js"></script>
<script src="../../easyui/easyUI.js"></script>
<script src="../../easyui/easyLayer.js"></script>
<style type="text/css">
.right {
	float: middle;
	width: 500px;
}

.right table {
	background: #E0ECFF;
	width: 100%;
}

.right td {
	background: #fafafa;
	text-align: center;
	font-weight: bold;
	padding: 2px;
}

.right td.drop {
	background: #fafafa;
	width: 300px;
}

.right td.title {
	background: #7BA0CD;
	color: white;
	font-weight: bold;
}

.right td.courseno {
	background: #E0ECFF;
}
</style>
</head>
<body>
<script>

	 var greyLayer ;
	 var grid;
	 $(function(){
		 //学员上课登记表grid
	 grid=$('#tt2').datagrid({ 
		 pagination:false,
		 singleSelect:true,
		 fit:true,//表格自动填充
		 loadMsg:'正在努力为您加载，请稍作等待…',//加载信息
		 toolbar:[{
		 text:'学员上课登记',
		 iconCls:'icon-add',
		 enable : true,// 按钮激活
		 handler:'newStudentCheckin'
		 }]});
	 //课程表grid
	 grid2 = $('#tt').datagrid({
	 pagination:true,
	 singleSelect:true,
	 fit:true,//表格自动填充
	 loadMsg:'正在努力为您加载，请稍作等待…',//加载信息
	 onClickRow:function(rowIndex,rowData){
		//根据选择的课程表，加载学员的登记记录
		var scheduleId = rowData.id;
		//加载学员上课登记grid
		try{
			 grid=$('#tt2').datagrid({
				 url:'/pxglxt/student/getStudentcheckinsByScheduleId?scheduleId='+scheduleId});
			 
		}catch(e){
			sys_alert('系统异常', "课程表ID:"+scheduleId+",可能课程信息已经被删除！", 'error');
		}
	 }
		 
	 });
	 //初始化pagination工具开始
	 var pagetool = $('#tt').datagrid('getPager');
	 pagetool.pagination({				
	 beforePageText:'第',
	 afterPageText:'页，共{pages}页',
	 displayMsg:'显示从 {from} 到  {to} , 总记录 {total} '});
	 
	 $('body').layout();
	 $('#btn-save,#btn-cancel').linkbutton();

	 win = $('#user-window').window({
	 collapsible:false,
	 minimizable:false, 
	 maximizable:true, 
	 closable:true,
	 onClose:function(){greyLayer.close();},
	 closed:true
	 });
	 form = win.find('form');
	 greyLayer = new easyMask(null,'100%','100%',100,'#000',8,true);

	 });
</script>

<div region="north" border="false"
	style="border-bottom: 1px solid #ddd; height: 32px; padding: 2px 5px; background: #fafafa;">
<div style="float: left;">请输入学员的姓名：<input type="text"
	name="sear_stu_name" id="sear_stu_name" widht="200px"> <a
	href="javascript:void(0)" class="easyui-linkbutton" plain="true"
	icon="icon-search" onclick="searchSchedule();">查询</a></div>
</div>
<div region="west" split="true" title="今日课程表"
	style="width: 500px; padding: 2px;" icon="icon-course">
<table id="tt">
	<thead>
		<tr>
			<th field="course_name" width="100%">课程名称</th>
			<th field="tea_real_name" width="100%">教师姓名</th>
			<th field="room_number" width="100%">教室</th>
			<th field="course_progress" width="100%">课时进度</th>
			<th field="schedule_date" width="100%">上课日期</th>
			<th field="schedule_begin" width="100%">上课时间</th>
			<th field="schedule_end" width="100%">下课时间</th>

		</tr>
	</thead>
</table>
</div>

<div region="center" title="学生上课登记记录" style="padding: 2px;"
	icon="icon-schedule">
<table id="tt2">
	<thead>
		<tr>
			<th field="id" width="100%">登记序号</th>
			<th field="stu_name" width="100%">学员姓名</th>
			<th field="schedule_id" width="100%">课程表编号</th>	
			<th field="checkin_time" width="100%">登记时间</th>			
		</tr>
	</thead>
</table>
</div>
</body>
</html>
